package com.example.ui.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.PagerAdapter;

import java.util.ArrayList;

/**
 * 董建业  时间:2017/4/13.
 */

public class AD_VP_Adapter extends FragmentPagerAdapter {

    private String[] titles = new String[]{"精选", "美容", "美甲", "按摩", "培训"};
    private ArrayList<Fragment> listfragment;
    public AD_VP_Adapter(FragmentManager fm,ArrayList<Fragment> listfragment) {
        super(fm);
        this.listfragment = listfragment;
    }

    @Override
    public Fragment getItem(int position) {
        return listfragment.get(position);
    }

    @Override
    public int getCount() {
        return listfragment.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}
